<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Choices Template</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Choices Template' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../extensions.html">Kits</a></li><li><a href="index.html">DialogueKit</a></li><li><b>Choices Template</b></li></ul></div>
<p class="purpose">Runtime support for dialogue choices.</p>

<ul class="toc"><li><a href="chtm.html#SP1">&#167;1. Runtime representation</a></li><li><a href="chtm.html#SP2">&#167;2. Extracting choice data</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Runtime representation.</b>Values representing choices are enumerated from 1 to <span class="extract"><span class="extract-syntax">NO_DIALOGUE_CHOICES</span></span>. Choices
have certain properties stored by Inform just as it would for any other
enumerated kind, and which this kit deals with by calls to <span class="extract"><span class="extract-syntax">GProperty</span></span> and
<span class="extract"><span class="extract-syntax">WriteGProperty</span></span>: in particular, <span class="extract"><span class="extract-syntax">performed</span></span> and <span class="extract"><span class="extract-syntax">recurring</span></span>.
</p>

<p class="commentary">In addition, though, the compiler (or more accurately the linker) generates
a table called <span class="extract"><span class="extract-syntax">TableOfDialogueChoices</span></span>. If <span class="extract"><span class="extract-syntax">dc</span></span> is an enumerated value then
<span class="extract"><span class="extract-syntax">TableOfDialogueChoices--&gt;dc</span></span> is the address of the metadata table for <span class="extract"><span class="extract-syntax">dc</span></span>.
(And <span class="extract"><span class="extract-syntax">TableOfDialogueChoices--&gt;0</span></span> is set to <span class="extract"><span class="extract-syntax">NO_DIALOGUE_CHOICES</span></span>.)
</p>

<p class="commentary">These choice data arrays occupy 3 words each, with fields as follows:
</p>

<ul class="items"><li>&#9679; <span class="extract"><span class="extract-syntax">TYPE_DCMETADATA</span></span> must be one of the <span class="extract"><span class="extract-syntax">*_DSEL</span></span> values, which in turn
determines the meaning of the <span class="extract"><span class="extract-syntax">CONTENT_DCMETADATA</span></span> field.
</li><li>&#9679; <span class="extract"><span class="extract-syntax">AVAILABILITY_DCMETADATA</span></span> is a function to test whether any <span class="extract"><span class="extract-syntax">if</span></span> or <span class="extract"><span class="extract-syntax">unless</span></span>
conditions attached to the choice are met; this returns <span class="extract"><span class="extract-syntax">true</span></span> if the choice is
available, <span class="extract"><span class="extract-syntax">false</span></span> if not. If the <span class="extract"><span class="extract-syntax">AVAILABILITY_DCMETADATA</span></span> is 0, the choice is
always available.
</li><li>&#9679; What's held in <span class="extract"><span class="extract-syntax">CONTENT_DCMETADATA</span></span> depends on the <span class="extract"><span class="extract-syntax">TYPE_DCMETADATA</span></span>:
</li><li>(a) For <span class="extract"><span class="extract-syntax">TEXTUAL_DSEL</span></span> it's an Inform 7 <span class="extract"><span class="extract-syntax">text</span></span> value for what is being offered
to the player (say, "Run out of the room screaming").
</li><li>(b) For <span class="extract"><span class="extract-syntax">ENDING_DSEL</span></span> and the other ending types, it's the value of <span class="extract"><span class="extract-syntax">deadflag</span></span>
to set, which will sometimes be a <span class="extract"><span class="extract-syntax">text</span></span> and sometimes just the value 3: see
WorldModelKit for why this is.
</li><li>(c) For <span class="extract"><span class="extract-syntax">PERFORM_DSEL</span></span> it's the dialogue beat to perform.
</li><li>(d) For <span class="extract"><span class="extract-syntax">INSTEAD_OF_DSEL</span></span>, <span class="extract"><span class="extract-syntax">AFTER_DSEL</span></span> and <span class="extract"><span class="extract-syntax">BEFORE_DSEL</span></span>, it's a function which
looks to see if the current action matches the given action pattern.
</li><li>(e) For everything else, it's 0 and meaningless.
</li></ul>
<p class="commentary">All of this must of course match what is compiled in <a href="../runtime-module/5-dci.html" class="internal">Dialogue Choice Instances (in runtime)</a>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">TYPE_DCMETADATA</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AVAILABILITY_DCMETADATA</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">CONTENT_DCMETADATA</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">STATE_DCMETADATA</span><span class="plain-syntax"> = </span><span class="constant-syntax">3</span><span class="plain-syntax">;</span>

<span class="plain-syntax">                                         </span><span class="comment-syntax">Flow markers:</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AGAIN_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;                 </span><span class="comment-syntax">&lt;-</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">ANOTHER_CHOICE_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">;        </span><span class="comment-syntax">-&gt; another choice</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">PERFORM_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">3</span><span class="plain-syntax">;               </span><span class="comment-syntax">-&gt; perform the falling beat</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">STOP_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">4</span><span class="plain-syntax">;                  </span><span class="comment-syntax">-&gt; stop</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">5</span><span class="plain-syntax">;                </span><span class="comment-syntax">-&gt; end the story</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_SAYING_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">6</span><span class="plain-syntax">;         </span><span class="comment-syntax">-&gt; end the story saying "You have succeeded"</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_FINALLY_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">7</span><span class="plain-syntax">;        </span><span class="comment-syntax">-&gt; end the story finally</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_FINALLY_SAYING_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">8</span><span class="plain-syntax">; </span><span class="comment-syntax">-&gt; end the story finally saying "You have failed"</span>

<span class="plain-syntax">                                         </span><span class="comment-syntax">Offered choices:</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">TEXTUAL_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">9</span><span class="plain-syntax">;               </span><span class="comment-syntax">&mdash; "Run out of the room screaming"</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">BEFORE_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">10</span><span class="plain-syntax">;               </span><span class="comment-syntax">&mdash; before taking the pocket watch</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">INSTEAD_OF_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">11</span><span class="plain-syntax">;           </span><span class="comment-syntax">&mdash; instead of taking something</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AFTER_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">12</span><span class="plain-syntax">;                </span><span class="comment-syntax">&mdash; after examining the rabbit hole</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">OTHERWISE_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">13</span><span class="plain-syntax">;            </span><span class="comment-syntax">&mdash; otherwise</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">CHOOSE_RANDOMLY_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">14</span><span class="plain-syntax">;      </span><span class="comment-syntax">&mdash; choose randomly</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">SHUFFLE_THROUGH_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">15</span><span class="plain-syntax">;      </span><span class="comment-syntax">&mdash; shuffle through</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">CYCLE_THROUGH_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">16</span><span class="plain-syntax">;        </span><span class="comment-syntax">&mdash; cycle through</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">STEP_THROUGH_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">17</span><span class="plain-syntax">;         </span><span class="comment-syntax">&mdash; step through</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">STEP_THROUGH_AND_STOP_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">18</span><span class="plain-syntax">; </span><span class="comment-syntax">&mdash; step through and stop</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">OR_DSEL</span><span class="plain-syntax"> = </span><span class="constant-syntax">19</span><span class="plain-syntax">;                   </span><span class="comment-syntax">&mdash; or</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Extracting choice data.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorChoiceStoryEnding</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">TYPE_DCMETADATA</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ENDING_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_SAYING_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ENDING_FINALLY_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_FINALLY_SAYING_DSEL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorChoiceTextContent</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CopyPV</span><span class="plain-syntax">(</span><span class="identifier-syntax">text</span><span class="plain-syntax">, </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">CONTENT_DCMETADATA</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorChoiceType</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">TYPE_DCMETADATA</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorReadChoiceState</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">STATE_DCMETADATA</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorWriteChoiceState</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">STATE_DCMETADATA</span><span class="plain-syntax"> = </span><span class="identifier-syntax">val</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorChoiceRawContent</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">CONTENT_DCMETADATA</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorChoiceFlowing</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">type</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">TYPE_DCMETADATA</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">type</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ANOTHER_CHOICE_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">AGAIN_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">STOP_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">PERFORM_DSEL</span>
<span class="plain-syntax">         </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_SAYING_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_FINALLY_DSEL</span>
<span class="plain-syntax">         </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_FINALLY_SAYING_DSEL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorChoiceAvailable</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> </span><span class="identifier-syntax">fn</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">fn</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">AVAILABILITY_DCMETADATA</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">fn</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">fn</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DirectorFollowFlowMarker</span><span class="plain-syntax"> </span><span class="identifier-syntax">dc</span><span class="plain-syntax"> </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> </span><span class="identifier-syntax">b</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &lt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">dc</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">NO_DIALOGUE_CHOICES</span><span class="plain-syntax">)) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WriteGProperty</span><span class="plain-syntax">(</span><span class="identifier-syntax">DIALOGUE_CHOICE_TY</span><span class="plain-syntax">, </span><span class="identifier-syntax">dc</span><span class="plain-syntax">, </span><span class="identifier-syntax">performed</span><span class="plain-syntax">, </span><span class="reserved-syntax">true</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">chdata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TableOfDialogueChoices</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">dc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">TYPE_DCMETADATA</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">AGAIN_DSEL</span><span class="plain-syntax">:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">debug_dialogue</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) { </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"-- again^"</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DirectorAgain</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">STOP_DSEL</span><span class="plain-syntax">:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">debug_dialogue</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) { </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"-- stop at: "</span><span class="plain-syntax">; </span><span class="identifier-syntax">DirectorTraceStack</span><span class="plain-syntax">(); }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DirectorStop</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">debug_dialogue</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) { </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"-- after stop: "</span><span class="plain-syntax">; </span><span class="identifier-syntax">DirectorTraceStack</span><span class="plain-syntax">(); }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ENDING_DSEL</span><span class="plain-syntax">, </span><span class="identifier-syntax">ENDING_SAYING_DSEL</span><span class="plain-syntax">, </span><span class="identifier-syntax">ENDING_FINALLY_DSEL</span><span class="plain-syntax">, </span><span class="identifier-syntax">ENDING_FINALLY_SAYING_DSEL</span><span class="plain-syntax">:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">debug_dialogue</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) { </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"-- ending at: "</span><span class="plain-syntax">; </span><span class="identifier-syntax">DirectorTraceStack</span><span class="plain-syntax">(); }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">deadflag</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">CONTENT_DCMETADATA</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">TYPE_DCMETADATA</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ENDING_FINALLY_DSEL</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">ENDING_FINALLY_SAYING_DSEL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">story_complete</span><span class="plain-syntax"> = </span><span class="reserved-syntax">true</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">PERFORM_DSEL</span><span class="plain-syntax">:</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">b</span><span class="plain-syntax"> = </span><span class="identifier-syntax">chdata</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">CONTENT_DCMETADATA</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">b</span><span class="plain-syntax"> </span><span class="reserved-syntax">ofclass</span><span class="plain-syntax"> </span><span class="identifier-syntax">Routine</span><span class="plain-syntax">) </span><span class="identifier-syntax">b</span><span class="plain-syntax"> = </span><span class="identifier-syntax">b</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DirectorPerformBeat</span><span class="plain-syntax">(</span><span class="identifier-syntax">b</span><span class="plain-syntax">); </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">default</span><span class="plain-syntax">: </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"*** Unimplemented choice ***^"</span><span class="plain-syntax">; </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="lntm.html">&#10094;</a></li><li class="progresssection"><a href="drtm.html">drtm</a></li><li class="progresssection"><a href="bttm.html">bttm</a></li><li class="progresssection"><a href="lntm.html">lntm</a></li><li class="progresscurrent">chtm</li><li class="progresssection"><a href="prtm.html">prtm</a></li><li class="progressnext"><a href="prtm.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

